const Router = require('koa-router'),
	report = require('../models/report_mod'),
	//jwt = require('jsonwebtoken'),
	//{JWT_KEY} = require('../lib/constant.js'),
	//_ = require('lodash'),
	router = new Router;
router.prefix('/api/report');

router.post('/', async (ctx, next) => {
	let { user_id, business_id, user_id2, business_id2, commodity_id, comment_id, dynamic_id, report_context } = ctx.request.body;
	let res = await report.Report(user_id, business_id, user_id2, business_id2, commodity_id, comment_id, dynamic_id, report_context);
	ctx.body = res;
})
router.get('/', async (ctx, next) => {
	let res = await report.Report_look();
	ctx.body = res;
})
router.delete('/', async (ctx, next) => {
	let { report_id } = ctx.request.body;
	let res = await report.Report_delete(report_id);
	ctx.body = res;
})
module.exports = router

